<?php
require_once("lib/util.php");
require_once("lib/db.php");
require_once("lib/incident.php");
session_start();
connect();
$incident_id= $_POST["incident_id"];
$creator_id=$_SESSION['logged_in_user'];
make_rating($incident_id,$creator_id);
$total_rating= total_rating($incident_id);
print json_encode(array("total_rating" => $total_rating));
close();
function make_rating($incident_id, $creator_id){
$query="INSERT into ratings (rater_user_id, incident_id) VALUES (?,?)" ;
query ($query, array($creator_id,$incident_id));

}


